Type Inference with Simple Selftypes is NP-complete
نویسندگان
چکیده
The metavariable self is fundamental in object-oriented languages. Typing self in the presence of inheritance has been studied by Abadi and Cardelli, Bruce, and others. A key concept in these developments is the notion of selftype, which enables flexible type annotations that are impossible with recursive types and subtyping. Bruce et al. demonstrated that, for the language TOOPLE, type checking is decidable. Open until now is the problem of type inference with selftype. In this paper we present a simple type system with selftype, recursive types, and subtyping, and we prove that type inference is NP complete. With recursive types and subtyping alone, type inference is known to be P-complete. Our example language is the object calculus of Abadi and Cardelli. Both our type inference algorithm and our lower bound are the first such results for a type system with selftype.
منابع مشابه
Type Inference for First-Class Messages with Feature Constraints
We present a constraint system OF of feature trees that is appropriate to specify and implement type inference for first-class messages. OF extends traditional systems of feature constraints by a selection constraint xhyiz “by firstclass feature tree” y, in contrast to the standard selection constraint x[ f ]y “by fixed feature” f . We investigate the satisfiability problem of OF and show that ...
متن کاملType Inference for Nested Self Types
We address the issue of decidability of the type inference problem for a type system of an object-oriented calculus with general selftypes. The fragment considered in the present paper is obtained by restricting the set of operators to the method invocation only. The resulting system, despite its syntactical simplicity, is sufficiently complicated to merit the study of the intricate constraints...
متن کاملTwo NP-Complete Problems in Software Security
A secure programming environment must offer protection mechanisms for regulating the interaction between mutually suspicious code units. Discretionary Capability Confinement (DCC) is a static type system recently proposed for expressing and enforcing access control policies in Java programs. This paper considers the computational complexity of the type reconstruction problem for DCC, that is, t...
متن کاملType Inference and Principal Typings for Symmetric Record Concatenation and Mixin Modules
The obvious simple type system for a λ-calculus extended with recordconcatenation has a typability problem that was believed to be expensive,and which we prove NP-complete. Some previous approaches to this prob-lem employ subtyping polymorphism. We present Bowtie, a system of simpletypes for record concatenation which has principal typings, no subtyping, anda clean separatio...
متن کاملA Second Order Uncertain Reasoning Framework for Assessing Probabilistic Inference in a Bayesian Network
Extended Abstract A Bayesian network 1] is a graph-theoretic approach representing both qualitative and quantitative probabilistic knowledge about the constraints on the conditional and marginal independencies among a set of random variables. A critical task of probabilistic inference in a Bayesian network is the derivation of the posterior probabilities (beliefs) of a set of It has been shown ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Nord. J. Comput.
دوره 4 شماره
صفحات -
تاریخ انتشار 1997